<template>
<div class="LoginRole">
  <div class="top">
    <Header title="请选择登录角色"
            left_title=""></Header>
    <div class='tabBar'>
      <router-link @click.native="select = 1"
                   :to="{path:'/LoginRole/DoctorType',query: {userid: this.userid, login: this.userid}}"
                   replace
                   class='tab' :class="{'act':select===1}" >
        个人
        <p class='line'></p>
      </router-link>
      <router-link
        @click.native="select = 2"
        :to="{path: '/LoginRole/TeamJuJia', query: {userid: this.userid, login: this.userid, team_type: 4}}"
        replace
        class='tab' :class="{'act':select===2}" >
        团队
        <p class='line'></p>
      </router-link>
    </div>
  </div>
  <router-view/>
</div>
</template>

<script>
import Header from '../../components/Vue/Header'
export default {
  name: 'LoginRole',
  data () {
    return {
      userid: this.$route.query.userid,
      select: 1
    }
  },
  mounted () {
    this.$route.meta.isShowtabbar = false
    if (this.$route.name == 'TeamJuJia') {
      this.select = 2
    }
    let token = this.$route.query.token
    if (token) {
      sessionStorage.setItem('token', token)
    }

    let sys = this.$route.query.sys
    if (sys) {
      sessionStorage.setItem('sys', sys)
    }
    sessionStorage.setItem('isShowtabbar', '1')
  },
  components: {
    Header
  },
  methods: {
    // 返回
    back () {
      this.$router.history.go(-1)
    }
  }
}
</script>

<style scoped lang="scss">
.LoginRole{
  width: 100%;
  height: 100%;
  background: #FAF9FE;
}
.top{
  position: sticky;
  top: 0;
}
.tabBar {
  width: 100%;
  height: 44px;
  overflow: hidden;
  background-color: white;

  .tab {
    width: 50%;
    float: left;
    font-size: 15px;
    color: #333333;
    line-height: 44px;
    text-align: center;
    position: relative;

    .line {
      display: none;
      width: 25px;
      height: 2px;
      border-radius: 1px;
      background-color: #1DA4F2;
      position: absolute;
      left: 50%;
      bottom: 5px;
      transform: translateX(-50%);
    }

    &.act {
      color: #1DA4F2;

      .line {
        display: block;
      }
    }
  }
}
</style>
